import java.util.Scanner;

public class CommonDivisor {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        boolean con = true;
        int c = 1;
        for( c = a<b?a:b;c>1;c--) {
            if(a%c == 0&&b%c == 0) {
                System.out.println(c+"为最大公约数");
                con = false;
                break;
            }
        }
        if(con) {
            System.out.println("没有公约数");
        }
    }
}
